﻿// =====================================================================
// <copyright file="EnumerableExtensionsTest.cs" author="David R. Guindo">
// 	Copyright (C) 2013. All rights reserved.
// </copyright>
// =====================================================================
// This code is released under the terms of the Apache 2.0 license, 
// http://apache.org/licenses/LICENSE-2.0.html
// =====================================================================

namespace AppBlock.Core.Test
{
    using System.Collections;
    using System.Collections.Generic;
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    [TestClass]
    public class EnumerableExtensionsTest
    {
        [TestMethod]
        public void Count_source_Test()
        {
            IEnumerable<string> target = new[] { "a", "b", "c" };
            Assert.AreEqual(3, target.Count());
        }

        [TestMethod]
        public void LongCount_source_Test()
        {
            IEnumerable<string> target = new[] { "a", "b", "c" };
            Assert.AreEqual(3, target.LongCount());
        }

        [TestMethod] public void Count_null_Test() { Assert.AreEqual(0, (null as IEnumerable).Count()); }
        [TestMethod] public void LongCount_null_Test() { Assert.AreEqual(0, (null as IEnumerable).LongCount()); }
    }
} 